package com.PAT.practice01;

import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: zjz
 * @Date: 2021/11/17/16:38
 * @Description:
 * @Target: 甲喊 甲划 乙喊 乙划
 *     每人口中喊出一个数字，同时用手比划出一个数字。如果谁比划出的数字正好等于两人喊出的数字之和，谁就赢了
 *    统计他们最后分别喝了多少杯酒。
 */
public class 划拳 {
    // 首先,他们输入n组数据,A1 A2  B1 B2
    public static void main(String[] args) {

        int ADrink = 0; // B赢A喝  result = 2;
        int BDrink = 0; // A赢B喝  result = 1;


        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        while (n-->0){
            int i = DealData(scanner.nextInt(), scanner.nextInt(), scanner.nextInt(), scanner.nextInt());
            if(i==2){
                ADrink++;
            }else if(i==1){
                BDrink++;
            }
        }


        System.out.println(ADrink+" "+BDrink);

    }

    // 方法:对于输入的数据进行处理,返回值,0平局,1A赢,2B赢
    public static int DealData(int A1,int A2,int B1,int B2){
        int result = -1;
        int sum = A1+B1;
       if(A2==sum&&B2!=sum){
            result = 1;
        }else if(A2!=sum&&B2==sum){
            result = 2;
        }else{
            result = 0;
        }

        return result;
    }




}
